<template>
  <div v-if="Object.keys(detailInfo).length !== 0" class="detail-goods-info">
    <div class="info-desc">
      <div class="start"></div>
      <div class="desc">{{detailInfo.desc}}</div>
      <div class="end"></div>
    </div>
    
    <div v-for="item, index in detailInfo.detailImage" :key="index" class="detail-goods-item">
      <div class="info-key">
        {{detailInfo.detailImage[0].key}}
      </div>
      <div class="info-list">
        <img v-for="(item, index) in item.list" :src="item" :key="index">
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "DetailGoodsInfo",
    props: {
      detailInfo: {
        type: Object,
        default() {
          return {}
        }
      }
    }
  }
</script>

<style scoped>
  .detail-goods-info {
    margin: 15px 0;
    padding: 0 10px 20px 0;
    border-bottom: 5px solid #eee;
  }
  .detail-goods-item {
    margin-top: 10px;
  }
  .detail-goods-item img {
    width: 100%;
  }
  .start, .end {
    position: relative;
    width: 100px;
    height: 2px;
    background-color: #ccc;
  }
  .end {
    float: right;
  }
  .start::before {
    content: "";
    width: 5px;
    height: 5px;
    position: absolute;
    top: -2.5px;
    background-color: black;
  }
  .end::after {
    content: "";
    width: 5px;
    height: 5px;
    position: absolute;
    top: -3.5px;
    right: 0;
    background-color: black;
  }
  .desc {
    font-size: 13px;
    padding: 10px 0;
  }
  .info-key {
    margin: 8px 0;
    font-weight: 600;
    font-size: 14px;
  }
</style>